/*
 * CS_SOCIAL_FRIEND_BUFF_SM.cpp
 *
 *  Created on: 2013. 6. 4.
 *      Author: the2
 */


#include "../../Command.h"
#include "../../User.h"
#include "../../Proxy.h"
#include "../../../../protocol/iFriends.h"
#include "../../NResource/Static.h"

namespace ProjectZ { namespace NCommand {

void Command::CS_SOCIAL_FRIEND_BUFF_SM(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;
	UseBuffSyn msg;

	*pPacket >> msg.gid;

	NResource::BalanceResource * balanceResource = NResource::Static::InstancePtr()->GetBalance();
	msg.buff_time = balanceResource->GetValue(pUser, EM_FRIEND_BUFF_TIME_ADD);
	msg.heart_count_max = balanceResource->GetValue(pUser, EM_FRIEND_POINT_MAX);

	NResource::SocialRewardResource * socialReward = NResource::Static::InstancePtr()->GetSocialReward();
	NResource::SocialRewardData::Flyweight * rewardData = socialReward->GetFly(pUser, NResource::SocialRewardData::FriendBuff);

	msg.send_heart_count = rewardData->_SEND_REWARD * rewardData->_IS_EVENT;
	msg.recv_heart_count = rewardData->_RECV_REWARD * rewardData->_IS_EVENT;
	msg.msg_type = rewardData->_MSG_TYPE;

	::ProjectZ::NProxy::SendFriendsServer(pUser->GetUserSeq(), msg);
}

} /*NCommand*/ } /*ProjectZ*/

